/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.breakaway.input;

/**
 * Input state represents a state of all operator
 * controls into this system (including buttons
 * and joystick values).
 * s
 * @author CJ
 */

public class InputState
{
    //TODO GIRL
    //Should have inputs into actual robot values;
    //e.g.  Toggle Kicker


    //
    boolean toggle_shooter;

    boolean dribbler_on;
    double  dribbler_speed;

    boolean trigger_claw;
    boolean activate_winch;

    boolean orient_by_camera;
    boolean safety_mode_enabled;

    boolean stop_motors;
    byte[]  stopped_motors;

    double drive_xAxis;
    double drive_yAxis;

    boolean kill;

    public InputState()
    {
        reset();
    }

    /**
     * Resets the state to default values.
     */
    public void reset()
    {
        trigger_claw = false;
        activate_winch = false;
        toggle_shooter   = false;
        dribbler_on  = false;
        dribbler_speed   = 0.0;
        orient_by_camera = false;
        safety_mode_enabled = false;
        stop_motors = false;
        stopped_motors = new byte[0];

        drive_xAxis = 0.0;
        drive_yAxis = 0.0;

        kill = false;
    }

    public boolean getTrigglerClaw(){
        return this.trigger_claw;
    }

    public boolean getActivateWinch(){
        return this.activate_winch;
    }


    public boolean getSafety(){
        return this.safety_mode_enabled;
    }

    public boolean isStopped(){
        return this.stop_motors;
    }

    public boolean getOrientByCamera(){
        return this.orient_by_camera;
    }

    public boolean getToggleShooter(){
        return this.toggle_shooter;
    }

    public boolean getDribblerOn(){
        return this.dribbler_on;
    }

    public byte[] getStoppedMotor(){
        if(this.stop_motors)
            return this.stopped_motors;
        return null;
    }

    public double getDribblerSpeed(){
        return this.dribbler_speed;
    }

    public double getXAxis(){
        return this.drive_xAxis;
    }

    public double getYAxis(){
        return this.drive_yAxis;
    }

    public String toString(){
        String ag = "";

        ag += "X axis:";
        ag += this.drive_xAxis;
        ag += '\n';

        ag += "Y axis:";
        ag += this.drive_yAxis;
        ag += '\n';

        ag += "Toggle Kicker";
        ag += this.toggle_shooter;
        ag += '\n';

        ag += "Dribbler On";
        ag += this.dribbler_on;
        ag += '\n';

        ag += "Orient";
        ag += this.orient_by_camera;
        ag += '\n';

        return ag;
    }
}
